home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / dftxt_r_.arc / DFLAT.DOC next >
Text File  |  1991-10-02  |  40KB  |  1,075 lines

  1. Window Classes:
  2.  
  3. Window classes define the behavior of windows. Each class has its own
  4. unique reaction to messages. Classes derive from other classes.
  5.  
  6.     NORMAL       base window for all window classes
  7.     APPLICATION  application window. has the menu 
  8.                  (derived from NORMAL)
  9.     TEXTBOX      textbox. base window for listbox, editbox, etc.
  10.                  (derived from NORMAL)
  11.     LISTBOX      listbox. base window for menubar
  12.                  (derived from TEXTBOX)
  13.     EDITBOX      editbox
  14.                  (derived from TEXTBOX)
  15.     MENUBAR      the application's menu bar
  16.                  (derived from NORMAL)
  17.     POPDOWNMENU  popdown menu
  18.                  (derived from LISTBOX)
  19.     BUTTON       command button in a dialog box
  20.                  (derived from TEXTBOX)
  21.     DIALOG       dialog box. parent to editbox, button, listbox, etc.
  22.                  (derived from NORMAL)
  23.     ERRORBOX     for displaying an error message
  24.                  (derived from DIALOG)
  25.     MESSAGEBOX   for displaying a message
  26.                  (derived from DIALOG)
  27.     HELPBOX      help window
  28.                  (derived from DIALOG)
  29.     TEXT         static text on a dialog box
  30.     RADIOBUTTON  radio button on a dialog box
  31.     CHECKBOX     check box on a dialog box
  32.     STATUSBAR    status bar at the bottom of application window
  33.  
  34.                D-Flat Window Class Tree
  35.     ┌─────────────────────────────────────────────┐
  36.     │                                             │
  37.     │      NORMAL                                 │
  38.     │        │                                    │
  39.     │        ├── APPLICATION                      │
  40.     │        │                                    │
  41.     │        ├── MENUBAR                          │
  42.     │        │                                    │
  43.     │        ├── TEXTBOX                          │
  44.     │        │      │                             │
  45.     │        │      ├── LISTBOX                   │
  46.     │        │      │      │                      │
  47.     │        │      │      └──── POPDOWNMENU      │
  48.     │        │      │                             │
  49.     │        │      ├── EDITBOX                   │
  50.     │        │      │                             │
  51.     │        │      ├── STATUSBAR                 │
  52.     │        │      │                             │
  53.     │        │      └── BUTTON                    │
  54.     │        │                                    │
  55.     │        └── DIALOG                           │
  56.     │              │                              │
  57.     │              ├── ERRORBOX                   │
  58.     │              │                              │
  59.     │              ├── MESSAGEBOX                 │
  60.     │              │                              │
  61.     │              └── HELPBOX                    │
  62.     │                                             │
  63.     └─────────────────────────────────────────────┘
  64.  
  65.  
  66. Window Attributes:
  67.  
  68. Every window has an attribute word that defines some of its
  69. appearance and behavior. The following values are bitwise flags that
  70. OR together to make a window's attributes.
  71.  
  72. You can establish default attributes for a window's class, add
  73. additional attributes when you create the window, and use the
  74. AddAttribute, ClearAttribute, and TestAttribute macros to change and
  75. test a window's attributes.
  76.  
  77.     SHADOW       has a shadow
  78.     MOVEABLE     can move the window with mouse or cursor
  79.     SIZEABLE     can resize the window with mouse or cursor
  80.     HASMENUBAR   has a menubar (an application window)
  81.     VSCROLLBAR   has a vertical scroll bar
  82.     HSCROLLBAR   has a horizontal scroll bar
  83.     VISIBLE      is visible
  84.     SAVESELF     saves its own video memory
  85.     TITLEBAR     has a title bar 
  86.     CONTROLBOX   has a control box and control menu
  87.     MINMAXBOX    has a min/max box 
  88.     NOCLIP       is not clipped to its parent's borders
  89.     READONLY     is a readonly textbox
  90.     MULTILINE    is a multiline editbox or listbox
  91.     HASBORDER    has a border
  92.     HASSTATUSBAR has a statusbar (application window only)
  93.  
  94. Messages:
  95.  
  96. A D-Flat program is message-driven. You initiate message processing
  97. with the init_messages function, create a window with the
  98. CreateWindow function, and go into the message dispatching loop with
  99. the dispatch_message function. 
  100.  
  101. A window can have a window-processing function. When the user causes
  102. events to occur by pressing keys and using the mouse, D-Flat sends
  103. messages to the window's function. That function can send messages to
  104. itself and other windows with the SendMessage and PostMessage
  105. functions.
  106.  
  107. Windows are declared as members of a class. Every class has a default
  108. window-processing function. If you do not provide one for an instance
  109. of a window class, the default one receives messages for the window.
  110. Your custom window-processing function--if one exists--should chain to
  111. the default window-processing function for the blass by calling the
  112. DefaultWndProc function.
  113.  
  114. There are five things a window-processing function can do with a
  115. message:
  116.   - ignore it and let the D-Flat default processing occur.
  117.   - suppress it by returning without chaining to the default
  118.     window-processing function for the window class.
  119.   - chain to the default window-processing function and then do some
  120.     additional processing.
  121.   - do some preliminary processing and then chain to the default
  122.     window-processing function.
  123.   - do all the processing of the message and then return without 
  124.     chaining to the default window-processing function for the 
  125.     window class.
  126.  
  127. Following are the messages that an application program would use.
  128. There are other messages, but they are used by D-Flat only.
  129.  
  130. Process Communication Messages  
  131.  
  132. START                  start message processing (not used now)
  133.   Sent:    
  134.   P1:      
  135.   P2:      
  136.   Returns: 
  137.  
  138. STOP                   stop message processing        
  139.   Sent:    by application window to NULLWND to stop message 
  140.            dispatch loop
  141.   P1:      
  142.   P2:      
  143.   Returns: 
  144.  
  145. COMMAND                send a command to a window
  146.   Sent:    to send command
  147.   P1:      command code (commands.h)
  148.   P2:      additional data (command-dependent)
  149.   Returns: Nothing if sent by PostCommand
  150.            Command-dependent value if sent by SendCommand
  151.  
  152.  
  153. Window Management Messages  
  154.  
  155. CREATE_WINDOW          create a window                
  156.   Sent:    by DFLAT to new window after window is created
  157.   P1:      
  158.   P2:      
  159.   Returns: 
  160.  
  161. SHOW_WINDOW            show a window                  
  162.   Sent:    by the app to the window to display the window
  163.   P1:      
  164.   P2:      
  165.   Returns: 
  166.  
  167. HIDE_WINDOW            hide a window                  
  168.   Sent:    by the app to the window to hide the window
  169.   P1:      
  170.   P2:      
  171.   Returns: 
  172.  
  173. CLOSE_WINDOW           delete a window                
  174.   Sent:    by the app to destroy a window
  175.   P1:      
  176.   P2:      
  177.   Returns: 
  178.  
  179. SETFOCUS               set and clear the focus        
  180.   Sent:    by D-Flat or the app to set or release the focus
  181.   P1:      true = set, false = release
  182.   P2:      
  183.   Returns: 
  184.  
  185. PAINT                  paint the window's data space  
  186.   Sent:    to paint the client area of a window
  187.   P1:      RECT relative to window (0/0 = upper left) to paint
  188.            or 0 to paint entire client area
  189.   P2:      
  190.   Returns: 
  191.  
  192. BORDER                 paint the window's border      
  193.   Sent:    to paint a window's border
  194.   P1:      RECT relative to window (0/0 = upper left) to paint
  195.            or 0 to paint entire border
  196.   P2:      
  197.   Returns: FALSE to suppress D-Flat title display 
  198.            (e.g. the window displays its own border)
  199.  
  200. TITLE                  display the window's title     
  201.   Sent:    by D-Flat when it is about to display a window's title
  202.   P1:      RECT relative to window (0/0 = upper left) to paint
  203.            or 0 to paint entire title
  204.   P2:      
  205.   Returns: FALSE to suppress D-Flat title display 
  206.            (e.g. the window displays its own title)
  207.  
  208. MOVE                   move the window                
  209.   Sent:    to move a window
  210.   P1:      new left coordinate
  211.   P2:      new upper coordinate
  212.   Returns: 
  213.  
  214. SIZE                   change the window's size       
  215.   Sent:    to resize a window
  216.   P1:      new right coordinate
  217.   P2:      new lower coordinate
  218.   Returns: 
  219.  
  220. MAXIMIZE               maximize the window            
  221.   Sent:    to maximize a window within its parent's client area
  222.   P1:      
  223.   P2:      
  224.   Returns: 
  225.  
  226. MINIMIZE               minimize the window            
  227.   Sent:    to minimize a window to an icon 
  228.   P1:      
  229.   P2:      
  230.   Returns: 
  231.  
  232. RESTORE                restore the window             
  233.   Sent:    to restore a window to its position and size prior to the
  234.            maximize or minimize operation
  235.   P1:      
  236.   P2:      
  237.   Returns: 
  238.  
  239. INSIDE_WINDOW          test x/y inside a window       
  240.   Sent:    to test to see if coordinates are inside a window
  241.   P1:      x
  242.   P2:      y
  243.   Returns: true or false
  244.  
  245.  
  246. Clock Messages  
  247.  
  248. CLOCKTICK              the clock ticked               
  249.   Sent:    every second to a window that has captured the clock
  250.   P1:      segment of time display string
  251.   P2:      offset of time display string
  252.   Returns: 
  253.  
  254. CAPTURE_CLOCK          capture clock into a window    
  255.   Sent:    to capture the clock
  256.   P1:      
  257.   P2:      
  258.   Returns: 
  259.  
  260. RELEASE_CLOCK          release clock to the system    
  261.   Sent:    to release the captured clock
  262.   P1:      
  263.   P2:      
  264.   Returns: 
  265.  
  266.  
  267. Keyboard and Screen Messages  
  268.  
  269. KEYBOARD               key was pressed                
  270.   Sent:    when key is pressed. sent to the window that has the focus 
  271.   P1:      keystroke
  272.   P2:      shift key mask
  273.   Returns: 
  274.  
  275. CAPTURE_KEYBOARD       capture keyboard into a window 
  276.   Sent:    by window to itself to capture the keyboard 
  277.            regardless of focus
  278.   P1:      
  279.   P2:      
  280.   Returns: 
  281.  
  282. RELEASE_KEYBOARD       release keyboard to system     
  283.   Sent:    by window to itelf to release the captured keyboard
  284.   P1:      
  285.   P2:      
  286.   Returns: 
  287.  
  288. KEYBOARD_CURSOR        position the keyboard cursor   
  289.   Sent:    to position the keyboard cursor
  290.   P1:      x (if sent by window, 0 = left client area)
  291.   P2:      y (if sent by window, 0 = top client area)
  292.            if sent with NULLWND, x/y are relative to the screen
  293.   Returns: 
  294.  
  295. CURRENT_KEYBOARD_CURSOR    read the cursor position
  296.   Sent:    to retrieve the cursor position
  297.   P1:      x (relative to the screen)
  298.   P2:      y (relative to the screen)
  299.   Returns: 
  300.  
  301. HIDE_CURSOR            hide the keyboard cursor       
  302.   Sent:    to hide the keyboard cursor
  303.   P1:      
  304.   P2:      
  305.   Returns: 
  306.  
  307. SHOW_CURSOR            display the keyboard cursor    
  308.   Sent:    to display the keyboard cursor
  309.   P1:      
  310.   P2:      
  311.   Returns: 
  312.  
  313. SAVE_CURSOR            save the cursor's configuration
  314.   Sent:    to save the keyboard cursor's current configuration 
  315.   P1:      
  316.   P2:      
  317.   Returns: 
  318.  
  319. RESTORE_CURSOR         restore the saved cursor       
  320.   Sent:    to restore a keyboard cursor's saved configuration 
  321.   P1:      
  322.   P2:      
  323.   Returns: 
  324.  
  325. SHIFT_CHANGED          the shift status changed       
  326.   Sent:    to in-focus window when the user presses or 
  327.            releases shift, alt, or ctrl key
  328.   P1:      BIOS shift key mask
  329.   P2:      
  330.   Returns: 
  331.  
  332. WAITKEYBOARD        wait for key release
  333.   Sent:    to wait for a keypress release
  334.   P1:
  335.   P2:      
  336.   Returns: 
  337.  
  338.  
  339. Mouse Messages  
  340.  
  341. RESET_MOUSE            reset the mouse
  342.   Sent:    to reset the mouse to the current screen configuration
  343.   P1:
  344.   P2:      
  345.   Returns: 
  346.  
  347. MOUSE_TRAVEL        set the mouse's travel
  348.   Sent:    to limit the mouse travel to a screen rectangle
  349.   P1:      address of a RECT
  350.   P2:      
  351.   Returns: 
  352.  
  353. MOUSE_INSTALLED        test for mouse installed       
  354.   Sent:    to see if the mouse is installed
  355.   P1:      
  356.   P2:      
  357.   Returns: true or false
  358.  
  359. RIGHT_BUTTON           right button pressed           
  360.   Sent:    to window when the user presses the right button
  361.            (sent only when mouse cursor is within the window
  362.             or the window has captured the mouse)
  363.   P1:      x
  364.   P2:      y
  365.   Returns: 
  366.  
  367. LEFT_BUTTON            left button pressed            
  368.   Sent:    to window when the user presses the left button
  369.            (sent only when mouse cursor is within the window
  370.             or the window has captured the mouse)
  371.   P1:      x
  372.   P2:      y
  373.   Returns: 
  374.  
  375. DOUBLE_CLICK           left button doubleclicked    
  376.   Sent:    to window when the user double-clicks the left button
  377.            (sent only when mouse cursor is within the window
  378.             or the window has captured the mouse)
  379.            (a LEFT_BUTTON message will have preceded this one)
  380.   P1:      x
  381.   P2:      y
  382.   Returns: 
  383.  
  384. MOUSE_MOVED            mouse changed position         
  385.   Sent:    to window when the mouse has moved
  386.            (sent only when mouse cursor is within the window
  387.             or the window has captured the mouse)
  388.   P1:      x
  389.   P2:      y
  390.   Returns: 
  391.  
  392. BUTTON_RELEASED        mouse button released          
  393.   Sent:    to window when user releases mouse button
  394.            (sent only when mouse cursor is within the window
  395.             or the window has captured the mouse)
  396.   P1:      x
  397.   P2:      y
  398.   Returns: 
  399.  
  400. CURRENT_MOUSE_CURSOR   get mouse position             
  401.   Sent:    to determine the current mouse position
  402.   P1:      address of x
  403.   P2:      address of y
  404.   Returns: 
  405.  
  406. MOUSE_CURSOR           set mouse position             
  407.   Sent:    to set the current mouse position
  408.   P1:      x
  409.   P2:      y
  410.   Returns: 
  411.  
  412. SHOW_MOUSE             make mouse cursor visible      
  413.   Sent:    to display the mouse cursor
  414.   P1:      
  415.   P2:      
  416.   Returns: 
  417.  
  418. HIDE_MOUSE             hide mouse cursor              
  419.   Sent:    to hide the mouse cursor
  420.   P1:      
  421.   P2:      
  422.   Returns: 
  423.  
  424. WAITMOUSE              wait until button released     
  425.   Sent:    to wait until the user releases the mouse button
  426.   P1:      
  427.   P2:      
  428.   Returns: 
  429.  
  430. TESTMOUSE              test any mouse button pressed  
  431.   Sent:    to see if either mouse button is pressed
  432.   P1:      
  433.   P2:      
  434.   Returns: true or false
  435.  
  436. CAPTURE_MOUSE          capture mouse into a window    
  437.   Sent:    by/to a window to capture all mouse activity 
  438.            regardless of whether it occurs inside this window
  439.   P1:      
  440.   P2:      
  441.   Returns: 
  442.  
  443. RELEASE_MOUSE          release the mouse to system    
  444.   Sent:    release a captured mouse
  445.   P1:      
  446.   P2:      
  447.   Returns: 
  448.  
  449.  
  450. Text Box Messages  
  451.  
  452. ADDTEXT                add text to the text box       
  453.   Sent:    to append a line of text to the text box
  454.   P1:      address of null-terminated string 
  455.            (textbox makes its own copy. string can go out of scope.)
  456.   P2:      
  457.   Returns: 
  458.  
  459. CLEARTEXT              clear the text box             
  460.   Sent:    clear all text from the text box
  461.   P1:      
  462.   P2:      
  463.   Returns: 
  464.  
  465. SETTEXT                set address of text buffer     
  466.   Sent:    To set text buffer to caller's text.
  467.   P1:      address of text buffer
  468.            (lines are terminated by \n without \0)
  469.            (textbox makes its own copy. string can go out of scope.)
  470.   P2:      length of text buffer
  471.   Returns: 
  472.  
  473. SCROLL                 vertical scroll of text box    
  474.   Sent:    to scroll a text window vertically one line
  475.   P1:      true = scroll up, false = scroll down
  476.   P2:
  477.   Returns: 
  478.  
  479. HORIZSCROLL            horizontal scroll of text box  
  480.   Sent:    to scroll a text window horizontally one line
  481.   P1:      true = scroll left
  482.   P2:      false = scroll right
  483.   Returns: 
  484.  
  485.  
  486. Edit Box Messages  
  487.  
  488. EB_GETTEXT             get text from an edit box      
  489.   Sent:    Get the line of text from a single-line editbox
  490.   P1:      address of receiving buffer
  491.   P2:      max length to copy
  492.   Returns: 
  493.  
  494. EB_PUTTEXT             put text into an edit box      
  495.   Sent:    replace old or insert first text into an editbox
  496.   P1:      address of text (null-terminated string)
  497.   P2:      
  498.   Returns: 
  499.  
  500.  
  501. Application Window Messages
  502.  
  503. ADDSTATUS               write text to the status bar
  504.   Sent:    to write to or clear status bar text area
  505.   P1:      address of text (null-terminated string) or NULL to clear
  506.   P2:      
  507.   Returns: 
  508.  
  509. List Box Messages  
  510.  
  511. LB_SELECTION               list box selection
  512.   Sent:    sent by list box to self and to parent (if parent is not
  513.            a simple LISTBOX window) when user moves to an entry on 
  514.            the list box.
  515.   P1:      selection number: 0, 1, ...
  516.   P2:      if multi-line selection listbox, shift status mask
  517.            if not, true = selection was same as choice (e.g. mouse)
  518.   Returns: 
  519.  
  520. LB_CHOOSE               list box choice        
  521.   Sent:    sent to parent of list box when user chooses an item 
  522.            from the list box
  523.   P1:      selection number: 0, 1, ...
  524.   P2:      
  525.   Returns: 
  526.  
  527. LB_CURRENTSELECTION    return the current selection   
  528.   Sent:    To get the current selection number (where the listbox
  529.            cursor is positioned)
  530.   P1:      
  531.   P2:      
  532.   Returns: selection number: 0, 1, ...
  533.  
  534. LB_GETTEXT             return the text of selection   
  535.   Sent:    To get a copy of the text at a specified line
  536.   P1:      Address of string to receive copy of text
  537.   P2:      Line number: 0, 1, ...
  538.   Returns: 
  539.  
  540. LB_SETSELECTION        sets the listbox selection     
  541.   Sent:    To change where the listbox cursor points
  542.   P1:      Line number: 0, 1, ...
  543.   P2:      
  544.   Returns: 
  545.  
  546.  
  547. API Functions & Macros:
  548.  
  549. These are functions and macros defined for use by applications
  550. programs. There are many others defined in the header files. These
  551. others are for D-Flat to use, and programmers need not be concerned
  552. about them except as an expression of their curiosity about how
  553. D-Flat works.
  554.  
  555.  
  556. (Note: These specifications are not in any orderly sequence yet.)
  557.  
  558.  
  559. -------------------------------------------------------------------
  560. void init_messages(void)
  561.  
  562. Call this function first to initialize message processing
  563.  
  564. -------------------------------------------------------------------
  565. WINDOW CreateWindow(
  566.     CLASS class,              /* class of this window       */
  567.     char *ttl,                /* title or NULL              */
  568.     int left, int top,        /* upper left coordinates     */
  569.     int height, int width,    /* dimensions                 */
  570.     void *extension,          /* pointer to additional data */
  571.     WINDOW parent,            /* parent of this window      */
  572.     int (*wndproc)(struct window *,MESSAGE,PARAM,PARAM),
  573.     int attrib)               /* window attribute           */
  574.  
  575. This function creates a window. It returns the WINDOW handle that
  576. mesages and functions use to identify the window.
  577.  
  578. -------------------------------------------------------------------
  579. void PostMessage(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  580.  
  581. Post a message to a window. The window will receive the message in
  582. turn during the message-dispatching loop.
  583.  
  584. -------------------------------------------------------------------
  585. int SendMessage(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  586.  
  587. Send a message to a window. The window will receive the message
  588. immediately. Control returns to the sender after the window has
  589. processed the message. The window can return an integer value.
  590.  
  591. This function can send system messages to NULLWND. System messages
  592. are ones that D-Flat processes without regard to a particular window.
  593. -------------------------------------------------------------------
  594. int dispatch_message(void)
  595.  
  596. The message dispatching loop. After opening the first window (usually
  597. the applications window), continue to call this function until it
  598. returns a FALSE value.
  599. -------------------------------------------------------------------
  600. int TestCriticalError(void)
  601.  
  602. -------------------------------------------------------------------
  603. int DefaultWndProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  604.  
  605. Call this from a window-processing function to chain to the default
  606. window-processing function for the window's class.
  607.  
  608. -------------------------------------------------------------------
  609. int BaseWndProc(CLASS class, WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  610.  
  611. Call this from the window-processing function of a derived window
  612. class to chain to the window-processing function of the base window's
  613. class.
  614.  
  615. -------------------------------------------------------------------
  616. int WindowHeight(WINDOW wnd)
  617. int WindowWidth(WINDOW wnd)
  618.  
  619. These functions return the window's height and width.
  620. -------------------------------------------------------------------
  621. int ClientWidth(WINDOW wnd)
  622. int ClientHeight(WINDOW wnd)
  623.  
  624. These functions return the height and width of the window's client
  625. area.
  626.  
  627. -------------------------------------------------------------------
  628. int GetTop(WINDOW wnd)
  629. int GetBottom(WINDOW wnd)
  630. int GetLeft(WINDOW wnd)
  631. int GetRight(WINDOW wnd)
  632.  
  633. These functions return the screen coordinates of the four corners of
  634. the window.
  635.  
  636. -------------------------------------------------------------------
  637. int GetClientTop(WINDOW wnd)
  638. int GetClientBottom(WINDOW wnd)
  639. int GetClientLeft(WINDOW wnd)
  640. int GetClientRight(WINDOW wnd)
  641.  
  642. These functions return the screen coordinates of the four corners of
  643. the window's client area.
  644.  
  645. -------------------------------------------------------------------
  646. WINDOW GetParent(WINDOW wnd)
  647.  
  648. Returns the parent of the window or NULLWND if the window has no
  649. parent.
  650. -------------------------------------------------------------------
  651. WINDOW GetFirstChild(WINDOW pwnd)
  652.  
  653. Returns the first child of a parent window or NULLWND if the window
  654. has no children.
  655.  
  656. -------------------------------------------------------------------
  657. WINDOW GetNextChild(WINDOW pwnd, WINDOW cwnd)
  658.  
  659. Call this function repetitively after GetFirstChild. It returns the
  660. next child window after the one specified in the second parameter. If
  661. there are no more children, the function returns NULLWND.
  662.  
  663. -------------------------------------------------------------------
  664. WINDOW GetLastChild(WINDOW pwnd)
  665.  
  666. Returns the last child of a p`rent window or NULLWND if the window
  667. has no children.
  668.  
  669. -------------------------------------------------------------------
  670. WINDOW GetPrevChild(WINDOW pwnd, WINDOW wnd)
  671.  
  672. Call this function repetitively after GetLastChild. It returns the
  673. previous child window before the one specified in the second
  674. parameter. If there are no more children, the function returns
  675. NULLWND.
  676.  
  677. -------------------------------------------------------------------
  678. int CharInView(WINDOW wnd, int x, int y)
  679.  
  680. Returns true if the x/y character position, relative to the window,
  681. is in view (not clipped at the border of a parent window or the
  682. screen.
  683.  
  684. -------------------------------------------------------------------
  685. int TopBorderAdj(WINDOW wnd)
  686.  
  687. Returns the value to add to a y coordinate of the window's client
  688. area to make it relative to the window top.
  689.  
  690. -------------------------------------------------------------------
  691. int BorderAdj(WINDOW wnd)
  692.  
  693. Returns the value to add to an x coordinate relative to the window's
  694. client area to make it relative to the window's left edge.
  695.  
  696. -------------------------------------------------------------------
  697. char *GetTitle(WINDOW wnd)
  698.  
  699. Returns the address of a window's title, or NULL if the window has no
  700. title.
  701.  
  702. -------------------------------------------------------------------
  703. void AddTitle(WINDOW wnd, char *title)
  704.  
  705. Adds or changes the title to an existing window.
  706.  
  707. -------------------------------------------------------------------
  708. CLASS GetClass(WINDOW wnd)
  709.  
  710. Returns the class of the window.
  711.  
  712. -------------------------------------------------------------------
  713. int GetAttribute(WINDOW wnd)
  714.  
  715. Returns the attribute word of a window.
  716.  
  717. -------------------------------------------------------------------
  718. void AddAttribute(WINDOW wnd, int attrib)
  719.  
  720. Adds one or more attributes to a window. OR the attribute values
  721. together.
  722.  
  723. -------------------------------------------------------------------
  724. void ClearAttribute(WINDOW wnd, int attrib)
  725.  
  726. Clears one or more attributes from a window. OR the attribute values
  727. together.
  728.  
  729. -------------------------------------------------------------------
  730. int TestAttribute(WINDOW wnd, int attrib)
  731.  
  732. Tests one or more attributes in a window. Returns true if any of them
  733. are set. OR the attribute values together.
  734.  
  735. -------------------------------------------------------------------
  736. int isVisible(WINDOW wnd)
  737.  
  738. Returns true if the window is visible.
  739.  
  740. -------------------------------------------------------------------
  741. char *GetText(WINDOW wnd)
  742.  
  743. Returns the address of the text buffer for a TEXTBOX or derived
  744. window class.
  745.  
  746. -------------------------------------------------------------------
  747. char *TextLine(WINDOW wnd, int line)
  748.  
  749. Returns the address of a specified line of text (0, 1, ...) in a
  750. TEXTBOX or derived class.
  751.  
  752. -------------------------------------------------------------------
  753. WINDOW inWindow(int x, int y)
  754.  
  755. Returns the WINDOW handle of the window that x/y are in or NULL if
  756. x/y is outside of any window.
  757.  
  758. -------------------------------------------------------------------
  759. int isActive(MENU *mnu, int command)
  760.  
  761. Returns true if the command (commands.h) on the menu is active
  762. (enabled).
  763.  
  764. -------------------------------------------------------------------
  765. char *GetCommandText(MBAR *mn, int cmd)
  766.  
  767. Returns the address of a menu command's title text.
  768.  
  769. -------------------------------------------------------------------
  770. void ActivateCommand(MENU *mnu, int command)
  771. void DeactivateCommand(MENU *mnu, int command)
  772.  
  773. Activate (enable) or deactivate (disable) a command (commands.h) on a
  774. menu.
  775.  
  776. -------------------------------------------------------------------
  777. int GetCommandToggle(MENU *mnu, int command)
  778. void SetCommandToggle(MENU *mnu, int command)
  779. void ClearCommandToggle(MENU *mnu, int command)
  780. void InvertCommandToggle(MENU *mnu, int command)
  781.  
  782. Some menu commands are toggles rather than executors of processes. 
  783. Examples are the Insert and Word wrap commands on the Options menu.
  784. These functions get, set, clear, and invert the toggle setting for a
  785. specified command on a specified menu.
  786.  
  787. -------------------------------------------------------------------
  788. int ItemSelected(WINDOW wnd, int line)
  789.  
  790. This function returns true if the specified item (0, 1, ...) on a
  791. multiple-line selection listbox is selected.
  792.  
  793. -------------------------------------------------------------------
  794. int DialogBox(
  795.   WINDOW wnd,        /* parent window of the dialog box        */
  796.   DBOX *db,          /* address of dialog box definition array */
  797.   int Modal,         /* trus if it is a modal dialog box       */
  798.   int (*wndproc)(struct window *, MESSAGE, PARAM, PARAM)
  799.                      /* the window processing function or NULL */
  800. )
  801.  
  802. This function executes a dialog box. If it is a modal dialog box, the
  803. function does not return until the user completes the dialog box. The
  804. return value will be true if the user has selected OK and false if
  805. the user has selected Cancel on the dialog box. If the dialog box is
  806. modeless, the function returns immediately, and the user can select
  807. other things from the screen while the dialog box is still active.
  808.  
  809. -------------------------------------------------------------------
  810. int DlgOpenFile(char *filespec, char *filename)
  811.  
  812. This function operates the Open File dialog box. The filespec pointer
  813. points to a default file path specification that the dialog box uses
  814. to display files, for example, *.DOC. If the function returns true,
  815. the space pointed to by the filename pointer will contain the path
  816. and filename selected by the user to be read.
  817.  
  818. -------------------------------------------------------------------
  819. int DlgSaveAs(char *filename)
  820.  
  821. This function operates the Save As dialog box. If the function returns
  822. true, the space pointed to by the filename pointer will contain the
  823. path and filename selected by the user where the file will be
  824. written.
  825.  
  826. -------------------------------------------------------------------
  827. void MessageBox(char *title, char *message)
  828. void ErrorMessage(char *message)
  829. int TestErrorMessage(char *message)
  830. int YesNoBox(char *question)
  831. WINDOW MomentaryMessage(char *message)
  832.  
  833. These functions display generic message boxes. The message text is
  834. one null-terminated string with newlines (\n) to indicate where lines
  835. are to be broken. The size of the boxes adjusts to the width of the
  836. longest line and the number of lines of text. A message may have no
  837. more lines of text than will fit into the largest window that the
  838. screen can display. You must account for the window's border's and
  839. the presence at the bottom of one or more command buttons.
  840.  
  841. The MessageBox function displays a message in a window with a title
  842. provided by the caller. The window contains the message and an OK
  843. command button.
  844.  
  845. The ErrorMessage function displays the message in an error box window
  846. with an OK command button.
  847.  
  848. The TestErrorMessage function is an error message with OK and Cancel
  849. command buttons. The function returns true if the user selects OK or
  850. presses Enter and false if the user selects Cancel or presses Esc.
  851.  
  852. The YesNoBox function displays the message with Yes and No command
  853. buttons. The function returns true if the user selects Yes or
  854. presses Enter and false if the user selects No or presses Esc.
  855.  
  856. The MomentaryMessage function displays a message box and returns its
  857. WINDOW handle. The caller must close the window. The purpose of this
  858. function is to allow you to display a message while some time
  859. consuming process is underway and then erase the message after the
  860. process is done but without any action required from the user.
  861.  
  862. -------------------------------------------------------------------
  863. int RadioButtonSetting(DBOX *db, enum commands cmd)
  864.  
  865. This function returns true if the specified command on the specified
  866. dialog box is a pressed radio button.
  867.  
  868. -------------------------------------------------------------------
  869. void EnableButton(DBOX *db, enum commands cmd)
  870.  
  871. This function enables a command button on a dialog box. command
  872. buttons are initially enabled when the dialog box is first opened.
  873.  
  874. -------------------------------------------------------------------
  875. void DisableButton(DBOX *db, enum commands cmd)
  876.  
  877. This function disables a command button on a dialog box. command
  878. buttons are initially enabled when the dialog box is first opened.
  879.  
  880. -------------------------------------------------------------------
  881. void PushRadioButton(DBOX *db, enum commands cmd)
  882.  
  883. This function presses the specified radio button command on the
  884. specified dialog box.
  885.  
  886. -------------------------------------------------------------------
  887. void PutItemText(WINDOW wnd, enum commands cmd, char *text)
  888.  
  889. This function appends a line of text to a TEXT, TEXTBOX, or EDITBOX
  890. control window in a dialog box. The wnd parameter is the WINDOW
  891. handle of the dialog box. The cmd parameter specifies the command
  892. associated with the control item. The text parameter points to the
  893. text to be added. The control window makes it own copy of the text,
  894. so the caller's copy can go out of scope. If the control window is a
  895. TEXTBOX or EDITBOX window, you must send a PAINT message to the
  896. control window so that the new text will display.
  897.  
  898. You must call this function while the dialog box is active. That
  899. means that if the dialog box is modal, you must call this function
  900. from within a custom window processing function that you supply when
  901. you call DialogBox.
  902.  
  903. -------------------------------------------------------------------
  904. void GetItemText(WINDOW wnd, enum commands cmd, char *text, int length)
  905.  
  906. This function copies the text from a TEXT, TEXTBOX, or EDITBOX
  907. control window in a dialog box.    The wnd parameter is the WINDOW
  908. handle of the dialog box. The cmd parameter specifies the command
  909. associated with the control item. The text parameter points to the
  910. caller's buffer where the text will be copied. The length parameter
  911. specifies the maximum number of characters to copy.
  912.  
  913. You must call this function while the dialog box is active. That
  914. means that if the dialog box is modal, you must call this function
  915. from within a custom window processing function that you supply when
  916. you call DialogBox.
  917.  
  918. -------------------------------------------------------------------
  919. char *GetEditBoxText(DBOX *db, enum commands cmd)
  920.  
  921. This function returns a pointer to the text associated with an
  922. editbox control in a dialog box. You can call it after the dialog box
  923. has completed processing. The buffer is on the heap. Do not free it.
  924. Instead, call SetEditBoxText with a NULL pointer.
  925.  
  926. If the text has not changed since it was initialized, this function
  927. returns NULL.
  928.  
  929. -------------------------------------------------------------------
  930. void SetEditBoxText(DBOX *db, enum commands cmd, char *text)
  931.  
  932. This function sets the text of a dialog box editbox. You can call
  933. this function before or while the dialog box is open. The dialog box
  934. makes it own copy on the heap, so your text can go out of scope.
  935.  
  936. -------------------------------------------------------------------
  937. char *GetDlgText(DBOX *db, enum commands cmd, char *text)
  938.  
  939. Similar to GetEditBoxText except that it works with text controls.
  940.  
  941. -------------------------------------------------------------------
  942. char *SetDlgText(DBOX *db, enum commands cmd, char *text)
  943.  
  944. Similar to SetEditBoxText except that it works with text controls.
  945.  
  946. -------------------------------------------------------------------
  947. char *GetDlgTextBox(DBOX *db, enum commands cmd, char *text)
  948.  
  949. Similar to GetEditBoxText except that it works with textbox controls.
  950.  
  951. -------------------------------------------------------------------
  952. char *SetDlgTextBox(DBOX *db, enum commands cmd, char *text)
  953.  
  954. Similar to SetEditBoxText except that it works with textbox controls.
  955.  
  956. -------------------------------------------------------------------
  957. void SetCheckBox(DBOX *db, enum commands cmd)
  958. void ClearCheckBox(DBOX *db, enum commands cmd)
  959. int CheckBoxSetting(DBOX *db, enum commands cmd)
  960.  
  961. These functions set, clear, and test the setting of a specified check
  962. box control item on a dialog box.
  963.  
  964. -------------------------------------------------------------------
  965. void LoadHelpFile(char *expath);
  966.  
  967. This function loads the help file named by the DFLAT_APPLICATION
  968. global constant with the .HLP file extension. The expath parameter
  969. points to the DOS path where the file can be found.
  970.  
  971. Call this function at the beginning of an application program.
  972.  
  973. -------------------------------------------------------------------
  974. void UnLoadHelpFile(void);
  975.  
  976. Call this function at the end of a D-Flat application to free the
  977. memory used by a help file.
  978.  
  979. -------------------------------------------------------------------
  980. void WriteTextLine(WINDOW wnd, RECT *rcc, int y, int reverse)
  981.  
  982. This function displays a text line from a TEXTBOX or derived window
  983. class. The text has apready been added to the window with ADDTEXT,
  984. etc. The y parameter specifies which line (0, 1, ...) relative to the
  985. window's text buffer to display. If the specified line is not in
  986. view, the function does nothing. If the reverse parameter is true,
  987. the line displays in the reverse-video colors of the window. The rcc
  988. RECT pointer is usually NULL for applications calls. It points to a
  989. rectangle relative to the window outside of which displays will not
  990. occur. 
  991.  
  992. This function calls the writeline function, so an application can
  993. embed CHANGECOLOR and RESETCOLOR commands in the text.
  994.  
  995. -------------------------------------------------------------------
  996. void writeline(WINDOW wnd, char *line, int x, int y, int pad)
  997.  
  998. This function writes a line of text to a window. The x and y
  999. coordinates point to the first character in the window's client area
  1000. where the line is to be written. The text must be null-terminated.
  1001. This function clips the line if it goes beyond the screen. If the
  1002. window does not have the NOCLIP attribute, the function clips the
  1003. line if it goes outside the borders of the window's parent. If the
  1004. pad parameter is true, writeline pads the window's line to its right
  1005. margin with spaces.
  1006.  
  1007. This function calls the wputs function, so an application can embed
  1008. CHANGECOLOR and RESETCOLOR commands in the text.
  1009.  
  1010. ------------------------------------------------------------------- v
  1011. void wputs(WINDOW wnd, void *line, int x, int y)
  1012.  
  1013. This function writes a line of text to a window. The x and y
  1014. coordinates point to the first character in the window's client area
  1015. where the line is to be written. The text must be null-terminated.
  1016.  
  1017. The caller can embed color change commands in the text. If the
  1018. CHANGECOLOR code occurs, the next two characters are the foreground
  1019. and background color values. These colors continue on the line until
  1020. the end of the line or the RESETCOLOR code occurs.
  1021.  
  1022. -------------------------------------------------------------------
  1023. void PutWindowChar(WINDOW wnd, int x, int y, int c)
  1024.  
  1025. This function writes the character c to a window. The x and y
  1026. coordinates are relative to the window's client area.
  1027.  
  1028. The function performs clipping. If the character is beyond the
  1029. screen's dimensions it is not written. If the window does not have
  1030. the NOCLIP attribute, the character is not written if its coordinates
  1031. are beyond the margins of its parent window (if the window has a
  1032. parent).
  1033.  
  1034. -------------------------------------------------------------------
  1035. void wputch(WINDOW wnd, int c, int x, int y)
  1036.  
  1037. This function writes the character c to a window. The x and y
  1038. coordinates are relative to the window's client area.
  1039.  
  1040. -------------------------------------------------------------------
  1041. void WindowClientColor(WINDOW wnd, int fg, int bg)
  1042.  
  1043. Changes the window client space's foreground and background colors.
  1044. -------------------------------------------------------------------
  1045. void WindowReverseColor(WINDOW wnd, int fg, int bg)
  1046.  
  1047. Changes the window's foreground and background reverse colors, which
  1048. are used to display such things as selected text blocks.
  1049. -------------------------------------------------------------------
  1050. void WindowFrameColor(WINDOW wnd, int fg, int bg)
  1051.  
  1052. Changes the window's foreground and background frame colors.
  1053. -------------------------------------------------------------------
  1054. void WindowHighlightColor(WINDOW wnd, int fg, int bg)
  1055.  
  1056. Changes the window's foreground and background highlight colors,
  1057. which are used to display highlighted items such as menu selector
  1058. bars.
  1059. -------------------------------------------------------------------
  1060.  
  1061.  
  1062. Configurable Items
  1063.  
  1064. Global Symbol File      Value Description
  1065. ------------- --------- ----- ---------------------------------------
  1066. MAXMESSAGES   DFLAT.H    50   Maximum D-Flat messages queued
  1067. MAXCONTROLS   DIALBOX.H  26   Maximum Controls on a dialog box
  1068. MAXRADIOS     DIALBOX.H  20   Maximum radio buttons in a group
  1069. MAXSAVES      SYSTEM.H   50   Maximum cursor saves
  1070. MAXPULLDOWNS  MENU.H     10   Maximum number of pull-down menus on
  1071.                               a menu bar
  1072. MAXSELECTIONS MENU.H     15   Maximum number of selections on 
  1073.                               a pull-down menu (includes separators)
  1074. MAXCASCADES   MENU.H      3   Maximum nesting level of cascaded menus
  1075.